package  
{
	import net.flashpunk.Entity;
	import net.flashpunk.FP;
	import net.flashpunk.graphics.Backdrop;
	import net.flashpunk.Sfx;
	import net.flashpunk.World;
	
	/**
	 * ...
	 * @author Edward Russell II
	 */
	public class GameWorld extends World 
	{
		 
		//variables that will be used in this class
		protected var bgm:Sfx = new Sfx(GC.BGM);
		protected var backdrop1:Backdrop = new Backdrop(GC.BACKDROP);
		protected var backdrop2:Backdrop = new Backdrop(GC.BACKDROP2);
		
		public function GameWorld() 
		{
			//add the various elements to the gameworld
			addGraphic(backdrop1);
			addGraphic(backdrop2);
			
			add(new HUD);
			add (new Level(GC.XML_LEVEL1, GC.TILEMAP_LEVEL1));
			
			//bgm.loop();
			
		}
		
		override public function update():void 
		{
			//scroll the backgrounds
			backdrop1.x -= .1;
			backdrop2.x -= .3;
			
			if (GV.GAME_OVER)
			{
				//stop the background music
				bgm.stop();
			}
			else
			{
				//spawn enemies
				//if (classCount(Enemy) <= 10) add(new Enemy);	
			}
			super.update();
		}
	}
}